Optimal. Leaf size=114 \[ a^3 (A+3 B) x+\frac {a^3 (7 A+6 B) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {5 a^3 A \sin (c+d x)}{2 d}+\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3054, 3047,
3102, 2814, 3855} \begin {gather*} \frac {a^3 (7 A+6 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {(2 A+B) \tan (c+d x) \left (a^3 \cos (c+d x)+a^3\right )}{d}+a^3 x (A+3 B)-\frac {5 a^3 A \sin (c+d x)}{2 d}+\frac {a A \tan (c+d x) \sec (c+d x) (a \cos (c+d x)+a)^2}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 3047
Rule 3054
Rule 3102
Rule 3855
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^3 (A+B \cos (c+d x)) \sec ^3(c+d x) \, dx &=\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int (a+a \cos (c+d x))^2 (2 a (2 A+B)-a (A-2 B) \cos (c+d x)) \sec ^2(c+d x) \, dx\\ &=\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int (a+a \cos (c+d x)) \left (a^2 (7 A+6 B)-5 a^2 A \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int \left (a^3 (7 A+6 B)+\left (-5 a^3 A+a^3 (7 A+6 B)\right ) \cos (c+d x)-5 a^3 A \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=-\frac {5 a^3 A \sin (c+d x)}{2 d}+\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int \left (a^3 (7 A+6 B)+2 a^3 (A+3 B) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=a^3 (A+3 B) x-\frac {5 a^3 A \sin (c+d x)}{2 d}+\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \left (a^3 (7 A+6 B)\right ) \int \sec (c+d x) \, dx\\ &=a^3 (A+3 B) x+\frac {a^3 (7 A+6 B) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {5 a^3 A \sin (c+d x)}{2 d}+\frac {(2 A+B) \left (a^3+a^3 \cos (c+d x)\right ) \tan (c+d x)}{d}+\frac {a A (a+a \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.94, size = 208, normalized size = 1.82 \begin {gather*} \frac {a^3 \left (4 A c+12 B c+4 A d x+12 B d x-14 A \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-12 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+14 A \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {A}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {A}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+4 B \sin (c+d x)+4 (3 A+B) \tan (c+d x)\right )}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.36, size = 137, normalized size = 1.20
method | result | size |
derivativedivides | \(\frac {A \,a^{3} \left (d x +c \right )+a^{3} B \sin \left (d x +c \right )+3 A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{3} B \left (d x +c \right )+3 A \,a^{3} \tan \left (d x +c \right )+3 a^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} B \tan \left (d x +c \right )}{d}\) | \(137\) |
default | \(\frac {A \,a^{3} \left (d x +c \right )+a^{3} B \sin \left (d x +c \right )+3 A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{3} B \left (d x +c \right )+3 A \,a^{3} \tan \left (d x +c \right )+3 a^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} B \tan \left (d x +c \right )}{d}\) | \(137\) |
risch | \(a^{3} x A +3 a^{3} B x -\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{3} B}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{3} B}{2 d}-\frac {i a^{3} \left (A \,{\mathrm e}^{3 i \left (d x +c \right )}-6 A \,{\mathrm e}^{2 i \left (d x +c \right )}-2 B \,{\mathrm e}^{2 i \left (d x +c \right )}-A \,{\mathrm e}^{i \left (d x +c \right )}-6 A -2 B \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {7 A \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {7 A \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}\) | \(217\) |
norman | \(\frac {\left (A \,a^{3}+3 a^{3} B \right ) x +\left (-4 A \,a^{3}-12 a^{3} B \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A \,a^{3}-3 a^{3} B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A \,a^{3}-3 a^{3} B \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (A \,a^{3}+3 a^{3} B \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 A \,a^{3}+6 a^{3} B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 A \,a^{3}+6 a^{3} B \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {a^{3} \left (7 A +4 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a^{3} \left (23 A +8 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {22 A \,a^{3} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {5 A \,a^{3} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a^{3} \left (A +4 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{3} \left (13 A +4 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {a^{3} \left (7 A +6 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{3} \left (7 A +6 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(395\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 165, normalized size = 1.45 \begin {gather*} \frac {4 \, {\left (d x + c\right )} A a^{3} + 12 \, {\left (d x + c\right )} B a^{3} - A a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, A a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{3} \sin \left (d x + c\right ) + 12 \, A a^{3} \tan \left (d x + c\right ) + 4 \, B a^{3} \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 137, normalized size = 1.20 \begin {gather*} \frac {4 \, {\left (A + 3 \, B\right )} a^{3} d x \cos \left (d x + c\right )^{2} + {\left (7 \, A + 6 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (7 \, A + 6 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, B a^{3} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, A + B\right )} a^{3} \cos \left (d x + c\right ) + A a^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int A \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 A \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 A \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int A \cos ^{3}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 B \cos ^{3}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int B \cos ^{4}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 192, normalized size = 1.68 \begin {gather*} \frac {\frac {4 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (A a^{3} + 3 \, B a^{3}\right )} {\left (d x + c\right )} + {\left (7 \, A a^{3} + 6 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (7 \, A a^{3} + 6 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (5 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.37, size = 207, normalized size = 1.82 \begin {gather*} \frac {B\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {7\,A\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,B\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,A\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________